home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12965 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  42 lines

  1. Path: scel.sequent.com!news
  2. From: Richard Shields <richards@sequent.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Templates, Microsoft and Borland
  5. Date: Fri, 22 Mar 1996 10:52:47 -0800
  6. Organization: Sequent Computer Systems Inc.
  7. Message-ID: <3152F6FF.AFC@sequent.com>
  8. NNTP-Posting-Host: w-richards.cha.sequent.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; I)
  13.  
  14. I tried this very simple code in both Microsoft 4.0 and Borland 4.52:
  15.  
  16. template <class T>
  17. class TMatrix
  18. {
  19. public:
  20. private:
  21. };
  22.  
  23. template <class T>
  24. TMatrix<T>
  25. operator *(TMatrix<T> *m1, TMatrix<T> *m2);
  26.  
  27.  
  28. I left out all the class data members and member functions for clarity.
  29.  
  30. When I compile these few statements in VC++ 4.0 I get this error:
  31.  
  32. error C2803: 'operator *' must have at least one formal parameter of 
  33. class type.
  34.  
  35. When I compile the code under Borland 4.52 I get no errors.  So, who is 
  36. more correct.  Is VC++ not supporting perfectly acceptable syntax or is 
  37. Borland supporting something out of the ordinary?  Personally, I see 
  38. nothing wrong with the code.
  39.  
  40. Thanks,
  41. Rich
  42.